package com.itheima.springcovid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class TestController {
    @Autowired
    public RestTemplate restTemplate;
    @RequestMapping("/test")
    public String test(){
        String forObject = restTemplate.getForObject("http://www.baidu.com/", String.class);
        System.out.println(forObject);
        return forObject;
    }

}
